home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: Locaton of an array?
- Date: Sat, 13 Jan 96 00:51:51 GMT
- Organization: none
- Message-ID: <821494311snz@genesis.demon.co.uk>
- References: <4d4iqk$hs3@overload.lbl.gov> <4d698s$g4r@news.iag.net> <4d6nd7$4gg@overload.lbl.gov>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4d6nd7$4gg@overload.lbl.gov>
- mfaiguen@issserv4.lbl.gov "Mikhail Faiguenblat" writes:
-
- >Tanmoy Bhattacharya (tanmoy@qcd.lanl.gov) wrote:
- >[stuff deleted]
- >: Btw, just out of curiosity, why do you care where it lives in
- >: absolute RAM?
- >
- >I just posted the description of the problem.
- >Also, if anyone has written or knows of a C program that uses DMA, how did
- >you deal with the issue of having to specify the physical addresses (I do not
- >know if that is the issue for other processors, but for x86 it is).
-
- Such issues can only be resolved by intimate knowledge og or help from
- your particular system. Since comp.lang.c concerns the C language and is
- an essentially system-independent newsgroup it is the wrong place to look.
- Try a DOS or Windows proramming newsgroup.
-
- >: By the way, the output of %p (as also the result of the (int) cast on
- >: a pointer) is upto the implementation. C can be implemented on machines
- >: which have no natural mapping onto a flat address space, so the
- >: original question may not have a definite meaning. An answer to the
- >: `why' that you ask is definitely required before more help can be
- >: provided.
- >
- >Ok, so C works with virtual addresses,
-
- C doesn't care how the addresses are implemented, as long as the rules
- of the language are met - basically pointers to different objects of
- compatible types must compare unequal and pointer arithmetic must work
- within the bounds of an array (or 1 past the end).
-
- >and all the registers (such as
- >segment register, offset register, etc.) also store virtual addresses.
-
- The C language has no concept of these types of register.
-
- >Also, a program when being executed writes to and reads from real memory.
- >This means that somewhere there is a virtual memory mamnager (?) which
- >keeps track of which segment of virtual memory corresponds to which
- >segment of real memory.
-
- Yes. For instance on PCs address tranlation is part of the archetecture
- of 386's and above.
-
- >Is it done on kernel level?
-
- It is often the OS/kernel that controls the address translation hardware
- and keep track of the overall virtual memory space.
-
- >I do remember that SB drivers on Linux use DMA, and they are linked into the
- >kernel and have a special buffer used for DMA transfer.
-
- Exactly. How you would achieve this using Linux kernel code is likely
- to be very different to how you achieve it using code under Windows. You
- need to ask in a newsgroup relevant to the implementation concerned.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-